package controller;

import pojo.Record;
import pojo.account.Manager;
import pojo.account.Reader;
import pojo.dto.FloorData;
import service.RecordService;
import service.SeatService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "ManagerIndexController", value = "/ManagerIndexController")
public class ManagerIndexController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        List<FloorData> floorDataList = new SeatService().queryAllFloorData();

        request.setAttribute("floorDataList", floorDataList);

        request.getRequestDispatcher("/view/manager/index.jsp").forward(request, response);
    }
}
